<div id="network-supply-bar1" style="height: 100%">
    <form class="form-horizontal fv-form fv-form-bootstrap" id="form">
        <div class="form-group has-feedback"  >
            <div class="col-sm-3">
                <label class="col-sm-4 control-label">商品单价</label>
                <div class="col-sm-8" >
                    <input type="text" class="form-control" name="standard_name" id="goodsPrice" data-fv-field="standard_name" value="50" placeholder="请输入商品单价:0.95">
                </div>
            </div>
            <div class="col-sm-3">
                <div class="col-sm-6">
                    <button type="button" id="select" class="btn btn-success">查询</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    $(function () {
        loadbar2();
        var optionLength=document.getElementById("prjId").options.length;
        if(optionLength==1){
            toastr.error('该项目下的订单数据没有数据，请在数据导入模块里面上传数据或者切换项目');
        }
        function loadbar2(){
            document.getElementById("loading").style.display="";
            var goodsPrice=$("#goodsPrice").val();
            var center = $("#prjId").val();
            $.ajax({
                url: "#springUrl('/network/supply/order/bar1')",
                data: {"center":center,"goodsPrice":goodsPrice},
                type: "POST",
                success: function (text) {
                    var d = JSON.parse(text);
                    if (d.success && d.data) {
                        $("#safetyStock").text(d.data.safetyStock);
                        $("#orderPort").text(d.data.orderPort);
                        $("#turnoverInventory").text(d.data.turnoverInventory);
                        $("#maxInventory").text(d.data.maxInventory);
                        $("#avgInventory").text(d.data.avgInventory);
                        $("#moneyLevel").text(d.data.moneyLevel);
                        $("#monthAvgInventory").text(d.data.monthAvgInventory);
                        $("#toSecondaryCenter").text(d.data.toSecondaryCenter);
                        document.getElementById("loading").style.display="none";
                    }else{
                        document.getElementById("loading").style.display="none";
                        toastr.error(d.message);
                    }
                },
            });
        }
        $("#select").click(function(){
            loadbar2();
        });
        $("select#prjId").change(function(){
            loadbar2();
        });

    });


</script>